package com.qimu.saiyou.model.vo;

import com.qimu.saiyou.model.entity.UserPaper;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author: FeiXiang
 * @Date: 2024年03月01日 21:36
 * @Version: 1.0
 * @Description:
 */
@Data
public class UserPaperVo {
    private Long id;

    /**
     * 考试状态 open-考试中 finish-结束
     */
    private String state;

    /**
     * 考试ID
     */
    private Long examId;

    /**
     * 赛事id
     */
    private Long competitionId;

    /**
     * 总分数
     */
    private Long totalScore;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 总时长（分钟）
     */
    private Long totalTime;

    /**
     * 是否阅卷 0-未阅 1-已阅
     */
    private Integer isRead;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 用户时间
     */
    private Integer userTime;

    /**
     * 对象转包装类
     *
     * @return
     */
    public static UserPaperVo objToVo(UserPaper userPaper) {
        if (userPaper == null) {
            return null;
        }
        UserPaperVo userPaperVo = new UserPaperVo();
        BeanUtils.copyProperties(userPaper, userPaperVo);
        return userPaperVo;
    }
}
